// run: $exec < input
#include <iostream>
#include <string>

int n;
std::string s;

int main()
{
	std::cin >> n >> s;
	auto l = s.find('L');
	auto r = s.find('R');
	if (r == std::string::npos && l == std::string::npos)
		std::cout << "1 1 \n";
	else if (r == std::string::npos) {
		auto ll = s.rfind('L');
		std::cout << ll + 1 << ' ' << l << '\n';
	} else if (l == std::string::npos) {
		auto lr = s.rfind('R');
		std::cout << r + 1 << ' ' << lr + 2 << '\n';
	} else {
		auto lr = s.rfind('R');
		std::cout << r + 1 << ' ' << lr + 1 << '\n';
	}
}

